﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content;

namespace SpaceGame
{
    class Ship : Entity
    {
        private int hull;
        private int armor;
        private int shields;
        private int energy;
        private int maxSpeed = 500;
        private float maxRotationSpeed = 0.1f;
        private Turret[] turrets;

        public Ship(ContentManager content, float rotation, float scale, Vector2 origin) : base(content, rotation, scale, origin)
        {
        }

        protected override float Z
        {
            get { return 0; }   //CHANGE
        }

        public Turret[] Turrets
        {
            get { return turrets; }
            set { turrets = value; }
        }

        public int Hull
        {
            get { return hull; }
            set { hull = value; }
        }

        public int Armor
        {
            get { return armor; }
            set { armor = value; }
        }

        public int Shields
        {
            get { return shields; }
            set { shields = value; }
        }

        public int Energy
        {
            get { return energy; }
            set { energy = value; }
        }

        public int MaxSpeed
        {
            get { return maxSpeed; }
            set { maxSpeed = value; }
        }

        public float MaxRotationSpeed
        {
            get { return maxRotationSpeed; }
            set { maxRotationSpeed = value; }
        }

        protected override void LoadContent(ContentManager content)
        {
            base.LoadContent(content);
            //Turret LoadContent done in turret constructor
        }

        public override void Update(GameTime gameTime)
        {
            base.Update(gameTime);
            foreach (Turret t in turrets)
            {
                t.Update(gameTime);
            }
        }

        public override void Draw(SpriteBatch spriteBatch)
        {
            base.Draw(spriteBatch);
            foreach (Turret t in turrets)
            {
                t.Draw(spriteBatch);
            }
        }
    }
}
